package com.heraleign.test.kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaTaskListener {
//    @Autowired
//    private EventService eventService;
//    @Autowired
//    private WorkOrderService workOrderService;

    @KafkaListener(topics = {"kafka-test"})
    public void receive(ConsumerRecord<String, String> message) {
        System.out.println("Kafka接收消息:" + message.value());
    }
}
